import logisticRegression.*;

import java.util.Vector;
import java.util.Random;
import java.lang.Math;
	
public class Example 
{	
	static private int sizeOfSet = 10;
	static private int xMax = 3000;
	static private int xMin = 1000;
	static private int yMax = 500;
	static private int yMin = 100;
	//giving 20 percent gain for size over min
	static private double sizeToPriceFactor = 1.2;
	
	public static void fillArrays (float x[], float y[])
	{
		Random rand = new Random();
		int temp;
		
		for(int i = 0; (i < x.length) && (i < y.length); i++)
		{
			temp = Math.abs(rand.nextInt());
			x[i] = (temp%(xMax-xMin))+xMin;
			
			temp = Math.abs(rand.nextInt());
			y[i] = (temp%(yMax-yMin))+yMin;
			
			//add in some percent of gain linked to size
			y[i] = y[i] * (((x[i]/xMin)/10) + (float)sizeToPriceFactor);
		}
	}
	
	public static void fillDataSet(Vector<TrainingSet<Float>> v, float x[], float y[])
	{
		for(int i = 0; (i < x.length) && (i < y.length); i++)
		{
			Float[] temp = new Float[1];
			temp[0] = x[i];
			TrainingSet<Float> s = new TrainingSet<Float>(temp, y[i]);
			
			if(!v.add(s))
				break;
			
			System.out.println("x ="+x[i]+" y="+y[i]);
		}
	}
	
	public static void main (String [] args)
	{
		float [] arrOfX = new float[sizeOfSet];
		float [] arrOfY = new float[sizeOfSet];
		Vector<TrainingSet<Float>> dataSet = new Vector<TrainingSet<Float>>();
		
		fillArrays(arrOfX, arrOfY);
		fillDataSet(dataSet, arrOfX, arrOfY);
	}
}
